﻿@using Newtouch.Common.Operator;
@using Newtouch.Infrastructure;
@{
    Layout = null;
    //是否页面加载时就必须选择Org
    var mediOrgList = ViewBag.MediOrgList as IList<FrameworkBase.MultiOrg.Domain.Entity.SysOrganizeVEntity>;
    //是否页面加载时就必须选择Org
    var needChooseOrg = (ViewBag.NeedChooseOrg as bool?) ?? false;

}
<!DOCTYPE html>
<html style="overflow: hidden;">
<head>
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache,no-store, must-revalidate">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="expires" CONTENT="0">
    <title>药房药库系统</title>
    @Html.Partial("_crossDomain")
    <link rel="shortcut icon" href="@SiteUrl.GetStaticResourceScriptUrl("~/img/newtouchcloud.ico")">
    <link href="@SiteUrl.GetStaticResourceScriptUrl("~/css/framework-font.css")" rel="stylesheet" />
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/jquery/jquery.choose.js")"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/bootstrap/bootstrap.js")"></script>
    <link href="@SiteUrl.GetStaticResourceScriptUrl("~/js/bootstrap/bootstrap.min.css")" rel="stylesheet" />
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/dialog/dialog.js")"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/cookie/jquery.cookie.js")"></script>
    <link href="@SiteUrl.GetStaticResourceScriptUrl("~/css/framework-theme.css")" rel="stylesheet" id="color-skin" />
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/framework-ui.js")"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/Content/js/framework-clientdata.js", false)"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/Content/js/newtouch-clientdata.js", false)"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/Newtouch-ui.js")"></script>
    <link href="@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/_all-skins.css")" rel="stylesheet" />
    <link href="@SiteUrl.GetStaticResourceScriptUrl("~/css/AdminLTE.min.css")" rel="stylesheet" />

    <script type="text/javascript">
        if (window.isIElte8()) {
            var cssurl = '@SiteUrl.GetStaticResourceScriptUrl("~/css/framework-ui-ie-lte8.css")';
            var linkHtml = '<link href="' + cssurl + '" rel="stylesheet" />';
            document.write(linkHtml);
        }
    </script>
</head>
<body style="overflow: hidden;" class="hold-transition skin-blue sidebar-mini" onload="Onload()" id="bodyPageHomeIndex"
      data-appid="@(Newtouch.Infrastructure.Constants.AppId)">
    <div id="ajax-loader" style="cursor: progress; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: #fff; z-index: 10000; overflow: hidden;">
        <img src="~/Content/img/ajax-loader.gif" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;" />
    </div>
    <div id="theme-wrapper">
        <header class="navbar" id="header-navbar">
            <div class="container" style="padding-right: 0px;">
                <a href="#" id="logo" class="navbar-brand" style="background-image:url(/Content/img/logo2.png); background-size:100%"></a>
				<div class="clearfix">
					<div class="nav-no-collapse navbar-left pull-left hidden-sm hidden-xs">
                        <ul class="nav navbar-nav pull-left">
                            <li>
                                <a class="btn btnshrink" id="make-small-nav"><i class="fa fa-dedent"></i></a>
                            </li>
                            <li onclick="@(mediOrgList != null && mediOrgList.Count > 1 ? "showSwitchOrgPrompt();" : "return;")">
                                <a>
                                    <b>@Html.Raw(ViewBag.OrgName)</b>
                                    @if (mediOrgList != null && mediOrgList.Count > 1)
                                    {
                                        <i id="iSwitchOrg" title="切换机构" class="fa fa-hospital-o"></i>
                                    }
                                </a>
                            </li>
                        </ul>
					</div>
					<div class="nav-no-collapse pull-right" id="header-nav">
						<ul class="nav navbar-nav pull-right">
							<li class="dropdown profile-dropdown">
								<a href="#" class="dropdown" data-toggle="dropdown">
									<i class="fa fa-user" style="float: left; margin-right: 5px; width: 25px; font-size: x-large; padding-top: 5px;"></i>
									<span class="hidden-xs" style="width:110px">@OperatorProvider.GetCurrent().UserCode【@Constants.CurrentYfbm.yfbmmc】</span>
								</a>
								<ul class="dropdown-menu pull-right">
									<li><a href="javascript:void(0);" onclick="SetUserPharmacy()"><i class="fa fa-exchange"></i>切换药房</a></li>
									@*<li><a class="menuItem" data-id="userInfo" href="/User/PersonalInfo"><i class="fa fa-user"></i>个人信息</a></li>*@
									@*<li><a href="javascript:void(0);"><i class="fa fa-inbox"></i>我的信箱</a></li>*@
									<li><a href="javascript:void(0);" onclick="layer.msg('浏览器缓存清除成功');"><i class="fa fa-trash-o"></i>清空缓存</a></li>
									<li>
										<a href="javascript:void(0);"><i class="fa fa-paint-brush"></i>皮肤设置</a>
										<div class="tab-pane" id="control-sidebar-home-tab">
										</div>
									</li>
									<li class="divider"></li>
									<li><a href="~/Login/OutLogin"><i class="ace-icon fa fa-power-off"></i>安全退出</a></li>
								</ul>
							</li>
						</ul>
					</div>
					<div class="nav-no-collapse pull-right" id="header-dic">

						<ul class="nav nav-pills nav-stacked">

							<li role="presentation" class="active">
								<a href="#" class="hidden-xs" style="padding-top:15px" data-toggle="dropdown">消息列表<span class="badge" id="badge1"></span></a>
								<ul class="dropdown-menu pull-right" style="width:100%;" id="uldiv">
									<li style="height:25px;"><a style="width:100%;text-align:center;" id="kcyj">库存预警<span class="badge" style="margin-left:5px;" id="badge2"></span></a></li>
									<li style="height:25px;"><a style="width:100%;text-align:center;" id="gqyj">过期预警<span class="badge" style="margin-left:5px;" id="badge3"></span></a></li>
								</ul>
							</li>
						</ul>

					</div>
					<div class="nav-no-collapse pull-right" id="header-dic">

						<ul class="nav nav-pills nav-stacked">

							<li role="presentation" class="active" id="countentli">
								<span style="float:left; padding-top:15px;" id="txtb"><img src="~/Content/img/消息提醒.png" width="20" height="20" /></span>
							</li>
						</ul>

					</div>

				</div>
            </div>
        </header>
        <div id="page-wrapper" class="container">
            <div class="row">
                <div id="nav-col" style="overflow-y:auto;">
                    <section id="col-left" class="col-left-nano">
                        <div id="col-left-inner" class="col-left-nano-content">
                            <div class="collapse navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
                                <ul class="nav nav-pills nav-stacked"></ul>
                            </div>
                        </div>
                    </section>
                </div>
                <div id="content-wrapper">
                    <div class="content-tabs">
                        <button class="roll-nav roll-left tabLeft">
                            <i class="fa fa-backward"></i>
                        </button>
                        <nav class="page-tabs menuTabs">
                            <div class="page-tabs-content" style="margin-left: 0px;">
                                <a href="javascript:void(0);" class="menuTab active" data-id="/Home/Default">欢迎首页</a>
                                @*<a href="javascript:;" class="menuTab" data-id="/Home/About" style="padding-right: 15px;">平台介绍</a>*@
                            </div>
                        </nav>
                        <button class="roll-nav roll-right tabRight">
                            <i class="fa fa-forward" style="margin-left: 3px;"></i>
                        </button>
                        <div class="btn-group roll-nav roll-right">
                            <button class="dropdown tabClose" data-toggle="dropdown">
                                页签操作<i class="fa fa-caret-down" style="padding-left: 3px;"></i>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="tabReload" href="javascript:void(0);">刷新当前</a></li>
                                <li><a class="tabCloseCurrent" href="javascript:void(0);">关闭当前</a></li>
                                <li><a class="tabCloseAll" href="javascript:void(0);">全部关闭</a></li>
                                <li><a class="tabCloseOther" href="javascript:void(0);">除此之外全部关闭</a></li>
                            </ul>
                        </div>
                        <button class="roll-nav roll-right fullscreen"><i class="fa fa-arrows-alt"></i></button>
                    </div>
                    <div class="content-iframe" style="background-color: #f9f9f9; overflow: hidden;">
                        <div class="mainContent" id="content-main" style="margin: 10px; margin-bottom: 0px; padding: 0;">
                            <iframe class="Newtouch_iframe" width="100%" height="100%" src="/Home/Default" frameborder="0" data-id="/Home/Default"></iframe>
                            <iframe class="Newtouch_iframe" width="100%" height="100%" src="/Home/About" frameborder="0" data-id="/Home/About"></iframe>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="loadingPage" style="display: none;">
        <div class="loading-shade"></div>
        <div class="loading-content" onclick="$.loading(false)">数据加载中，请稍后…</div>
    </div>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/index.common.js")"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/Content/js/index.js", false)"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/indextab.js")"></script>
    <script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/loading/pace.min.js")"></script>
	<script type="text/javascript">
        var my_skins;
        $(document).ready(function () {
            my_skins = [
    "skin-black",
    "skin-red",
    "skin-white",
    "skin-purple",
    "skin-green",
    "skin-black-light",
    "skin-red-light",
    "skin-white-light",
    "skin-purple-light",
    "skin-green-light"
            ];
        });

		var requexx = "";
		var times;
		var type = "";
        var msgtypecodes = "";
        var kcyjypcode = "", gqyjypcode = "";
        $(function () {
            $('#txtb').hide();
            if (requexx != 1) {
                MSGQuery();
            }
            else {
                clearTimeout(times);
            }
        });
		//图标闪烁
		function blink(selector) {
			$(selector).fadeOut('slow', function () {
				$(this).fadeIn('slow', function () {
					blink(this);
				});
			});
        }
		function MSGQuery() {
			//yzshzyh = ""; yzzxzyh = ""; requexx = ""; msgtypecodes = "";
			$('#txtb').stop().fadeIn();
			$('#txtb').stop().fadeOut();
			$('#txtb').hide();
			//msgtypecodes = 1;
			//$('#txtb').show();
			//blink('#txtb');
			$.ajax({
				url: "/Home/getmesquery",
				datatype: "json",
				async: false,
				type: "post",
                success: function (rst) {
					var da = JSON.parse(rst);
					if (da != "" && da != null) {
						$("#badge1").text(da.kcyj + da.gqyj);
						$("#badge2").text(da.kcyj == 0 ? "" : da.kcyj);
						$("#badge3").text(da.gqyj == 0 ? "" : da.gqyj);
                        //$("#countents").text(da[0].msgcontent);
						if (da.rows != "") {
							$('#txtb').show();
							blink('#txtb');
                        }
                        var rows = da.rows
                        //1:库存预警 2:过期预警
						for (var i = 0; i < rows.length; i++) {
							if (rows[i].typeas == "1") {
								kcyjypcode += rows[i].ypCode + ",";
						    }
							else if (rows[i].typeas == "2"){
								gqyjypcode += rows[i].ypCode + ",";
						    }

						}
					} else {
						requexx = 1;
					}

				},
				error: function () {

				}
			})

		}

		$("#kcyj").click(function () {
			kcyj();
		});

		$("#gqyj").click(function () {
			gqyj();
		});
		function kcyj() {
			var a1 = $("#badge2").text("");
			var badge2 = Number($("#badge2").text());
			var badge3 = Number($("#badge3").text());
			var badge1 = badge2 + badge3;
			$("#badge1").text(badge1 == 0 ? "" : badge1);
			if (badge1 == 0) {
				$('#txtb').stop().fadeIn();
				$('#txtb').stop().fadeOut();
                $('#txtb').hide();
            }
			sessionStorage.setItem('kcyjyp', kcyjypcode);
			top.top.$.Newtouchtab.addTabWithOutMenu({ name: "库存量查询（消息提醒）", enName: "", url: "/StorageManage/DrugStockSearch/StockQuery"});
		}

		function gqyj() {
			var a1 = $("#badge3").text("");
			var badge2 = Number($("#badge2").text());
			var badge3 = Number($("#badge3").text());
			var badge1 = badge2 + badge3;
			$("#badge1").text(badge1 == 0 ? "" : badge1);
			if (badge1 == 0) {
				$('#txtb').stop().fadeIn();
				$('#txtb').stop().fadeOut();
                $('#txtb').hide();
            }
			sessionStorage.setItem('gqyjyp', gqyjypcode);
			top.top.$.Newtouchtab.addTabWithOutMenu({ name: "过期药品查询（消息提醒）", enName: "", url: "/StorageManage/DrugStockSearch/ExpiredDrugsView"});
        }

        function Onload() {
            //Create the new tab
            var tab_pane = $("<div />", {
                "id": "control-sidebar-theme-demo-options-tab",
                "class": "tab-pane active"
            });

            //Create the menu
            var demo_settings = $("<div />");
            var skins_list = $("<ul />", { "class": 'list-unstyled clearfix' });
            //Dark sidebar skins
            var skin_black =
                $("<li />", { style: "float:left; width: 33.33333%; padding: 5px;" })
                    .append("<a href='javascript:void(0);' data-skin='skin-black' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
                    + "<div><span style='display:block; width: 20%; float: left; height: 7px; background: #383d41;'></span><span class='bg-light-blue' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
                    + "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
                    + "</a>"
                    + "<p class='text-center no-margin'>Black</p>");
            skins_list.append(skin_black);

            var skin_black_light =
              $("<li />", { style: "float:left; width: 33.33333%; padding: 5px;" })
                  .append("<a href='javascript:void(0);' data-skin='skin-black-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
                  + "<div><span style='display:block; width: 20%; float: left; height: 7px; background: #383d41;'></span><span class='bg-light-blue' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
                  + "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
                  + "</a>"
                  + "<p class='text-center no-margin' style='font-size: 12px'>Black Light</p>");
            skins_list.append(skin_black_light);

            var skin_white_light =
                  $("<li />", { style: "float:left; width: 33.33333%; padding: 5px;" })
                  .append("<a href='javascript:void(0);' data-skin='skin-white-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
                  + "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-yellow-active'></span><span class='bg-yellow' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
                  + "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #333743;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
                  + "</a>"
                  + "<p class='text-center no-margin' style='font-size: 12px;'>White Light</p>");
            skins_list.append(skin_white_light);
            demo_settings.append(skins_list);

            tab_pane.append(demo_settings);
            $("#control-sidebar-home-tab").after(tab_pane);

            setup();
        };
        function setup() {
            var tmp = get('skin');
            if (tmp && $.inArray(tmp, my_skins))
                change_skin(tmp);

            //Add the change skin listener
            $("[data-skin]").on('click', function (e) {
                if ($(this).hasClass('knob'))
                    return;
                e.preventDefault();
                change_skin($(this).data('skin'));
            });

            //Add the layout manager
            $("[data-layout]").on('click', function () {
                change_layout($(this).data('layout'));
            });

            $("[data-controlsidebar]").on('click', function () {
                change_layout($(this).data('controlsidebar'));
                var slide = !AdminLTE.options.controlSidebarOptions.slide;
                AdminLTE.options.controlSidebarOptions.slide = slide;
                if (!slide)
                    $('.control-sidebar').removeClass('control-sidebar-open');
            });

            $("[data-sidebarskin='toggle']").on('click', function () {
                var sidebar = $(".control-sidebar");
                if (sidebar.hasClass("control-sidebar-dark")) {
                    sidebar.removeClass("control-sidebar-dark")
                    sidebar.addClass("control-sidebar-light")
                } else {
                    sidebar.removeClass("control-sidebar-light")
                    sidebar.addClass("control-sidebar-dark")
                }
            });

            $("[data-enable='expandOnHover']").on('click', function () {
                $(this).attr('disabled', true);
                AdminLTE.pushMenu.expandOnHover();
                if (!$('body').hasClass('sidebar-collapse'))
                    $("[data-layout='sidebar-collapse']").click();
            });
        };
        function change_skin(cls) {
            $.each(my_skins, function (i) {
                $("body").removeClass(my_skins[i]);
            });

            $("body").addClass(cls);
            store('skin', cls);
            var pifu = "#1ABC9C";
            var cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-blue.css")";  //~/Content/css/framework-theme.css
            switch (cls) {
                case "skin-black": pifu = "#383d41"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-blue.css")"; break;

                case "skin-red": pifu = "#e98a7e"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-red.css")"; break;
                @*case "skin-white": pifu = "#f39c12"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-yellow_tab.css")"; break*@
                case "skin-purple": pifu = "#9895c6"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-purple.css")"; break;
                case "skin-green": pifu = "#1ABC9C"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-blue.css")"; break;
                case "skin-black-light": pifu = "#383d41"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-blue-left.css")"; break;
                case "skin-black-light": pifu = "#fff"; break;
                case "skin-red-light": pifu = "#e98a7e"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-red-left.css")"; break;
                case "skin-white-light": pifu = "#fff"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-yellow.css")"; break;
                case "skin-purple-light": pifu = "#9895c6"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-purple-left.css")"; break;
                case "skin-green-light": pifu = "#1ABC9C"; cssURL = "@SiteUrl.GetStaticResourceScriptUrl("~/css/skins/framework-theme-green-left.css")"; break;
                default: break;
            }
            $("#header-navbar").css("background", pifu);
            $("#color-skin").attr("href", cssURL);
            setlocalStorage("cssPath", cssURL); //localstorage
            return false;
        };
        function change_layout(cls) {
            $("body").toggleClass(cls);
            AdminLTE.layout.fixSidebar();
            //Fix the problem with right sidebar and layout boxed
            if (cls == "layout-boxed")
                AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
            if ($('body').hasClass('fixed') && cls === 'fixed') {
                AdminLTE.pushMenu.expandOnHover();
                AdminLTE.layout.activate();
            }
            AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
            AdminLTE.controlSidebar._fix($(".control-sidebar"));
        };
        function store(name, val) {
            if (typeof (Storage) !== "undefined") {
                localStorage.setItem(name, val);
            } else {
                window.alert('Please use a modern browser to properly view this template!');
            }
        };
        function get(name) {
            if (typeof (Storage) !== "undefined") {
                return localStorage.getItem(name);
            } else {
                window.alert('Please use a modern browser to properly view this template!');
            }
        }
        //切换用户药房
        function SetUserPharmacy() {
            $.modalOpen({
                id: "Form",
                title: "库房切换",
                url: "/Home/SetUserPharmacyForm",
                width: "500px",
                height: "400px",
                callBack: function (iframeId) {
                    $.currentWindow(iframeId).AcceptClick(function () {

                    });
                }
            });
        }
	</script>
</body>
</html>
